﻿#region Using Directives

    using System;

    using MarketPulse.BusinessLogic.Common;

#endregion

namespace MarketPulse.BusinessLogic.Private.StateMachine
{
    [Serializable]
    internal class AssignmentStateReleased : AssignmentStateBase
    {
        internal AssignmentStateReleased(bool throwIfInvalid) : base(throwIfInvalid)
        {
            mAssignmentStateType = AssignmentStatusTypeList.Released;
            InitAssignmentStateString();
        }

        public override bool Assign(IAssignmentStateContext state, bool tryTransition, Guid userGuid, DateTime plannedDateTime)
        {
            if (!tryTransition)
            {
                state.SetState(new AssignmentStateAssigned(mThrowIfInvalid));
            }
            return true;
        }
    }
}
